package chatGUI;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * @author Michael & Pierre
 */
/**
 * Action Listener called when the Tab menu DeleteCurrent button is clicked
 */
public class DeleteTabMenuListener implements ActionListener{
	
	/**
	 * To keep track of the calling instance of the platform-specific GUI
	 */
	private JavaGUI gui;
	
	/**
	 * Constructor to memorize the calling platform-specific GUI's address
	 * @param ihm
	 */
	public DeleteTabMenuListener(JavaGUI ihm) {
		this.gui = ihm;
	}
	
	/**
	 * Demands the platform-specific GUI to delete current (selected) tab
	 * @param arg0
	 */
	@Override
	public void actionPerformed(ActionEvent arg0) {
		if (gui.getIndexTab() > 0) {
			gui.deleteTab();
		}

	}
}